#include <iostream>
#include <signal.h>
#include <unistd.h>

using namespace std;

void myhandler(int signo)
{
    cout << "process get a signal: " << signo <<endl;
}

int main()
{
    signal(9, myhandler);

    while(1)
    {
        cout << "I am a process, pid: " << getpid() << endl;
        sleep(1);
    }
    return 0;
}